Constants are created using a constant definition. Constant definitions also associate an identifier with a storage location in memory, but unlike variable declarations, a value is immediately assigned to the location. The value of the constant cannot be modified by a script after it is defined.
Constant definitions also occur at one location in the script, the CONST block. This area of the script is located at the beginning of the main program block, prior to both the main body of script code and the
VAR block. The block is indicated by using the
CONST keyword. Like the
VAR block, the
CONST block is the only location where this type of storage declaration (constant definitions) is allowed.
Constants can store any basic data type (INTEGER,
LONGINT,
REAL,
STRING,
CHAR, or
BOOLEAN). VectorScript also supports the use of trigonometric, ordinal, and other mathematical functions in defining constants. The following table lists functions which are supported in the constant definition block and can be used to define constants in scripts.